  <?php 
  $repository=BO::getProductBORepository();
  $id=getFormValue('id');
  $productBO = $repository->getProductBO($id);	?>
<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">Product : <?php echo $productBO->getName() ?></div>
  <div class="panel-body">
		<p>
		
		</p>	

	  	
		<ul class="nav nav-tabs" role="tablist">
		  <li><a href="dispatch.php?target=product-edit&id=<?php echo $productBO->getID() ?>">General</a></li>
		  <li class="active"><a href="dispatch.php?target=product_attribute-edit&id=<?php echo $productBO->getID() ?>">Attributes</a></li>
		  <li><a href="dispatch.php?target=product_images-edit&id=<?php echo $productBO->getID() ?>">Images</a></li>
		  <li><a href="dispatch.php?target=product_pricing-edit&id=<?php echo $productBO->getID() ?>">Pricing</a></li>
		  <li><a href="dispatch.php?target=product_categories-edit&id=<?php echo $productBO->getID() ?>">Categories</a></li>
		  <li><a href="dispatch.php?target=product_variations-edit&id=<?php echo $productBO->getID() ?>">Variations</a></li>
		</ul>
		<div class="panel">	
			<div class="panel-body">
				<div class="bs-example">
					<h1>Product :Standard Attributes</h1>
					<form class="form-horizontal" action="dispatch.php" method="post">
						<input type="hidden" name="target" value="product_attribute-save">
						<input type="hidden" name="id" value="<?php echo $productBO->getID() ?>">
								<div class="form-group">
									<label class="control-label col-xs-3" for="inputEmail">Brand:</label>
									<div class="col-xs-3">
										<input type="input" name="brand" value="<?php echo $productBO->getBrand() ?>" class="form-control" id="inputName" placeholder="Brand">
									</div>
									<label class="control-label col-xs-3" for="inputEmail">Partner:</label>
									<div class="col-xs-3">
										<input type="input" name="Partner" value="<?php echo $productBO->getPartner() ?>" class="form-control" id="inputName" placeholder="Partner">
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-xs-3" for="inputEmail">Color:</label>
									<div class="col-xs-3">
										<input type="input" name="color" value="<?php echo $productBO->getColor() ?>" class="form-control" id="inputName" placeholder="Color">
									</div>
									<label class="control-label col-xs-3" for="inputEmail">Size:</label>
									<div class="col-xs-3">
										<input type="input" name="size" value="<?php echo $productBO->getSize() ?>" class="form-control" id="inputName" placeholder="Size">
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-xs-3" for="inputEmail">Weight:</label>
									<div class="col-xs-3">
										<input type="input" name="weight" value="<?php echo $productBO->getWeight() ?>" class="form-control" id="inputName" placeholder="weight">
									</div>
									<label class="control-label col-xs-3" for="inputEmail">Packing:</label>
									<div class="col-xs-3">
										<input type="input" name="packing" value="<?php echo $productBO->getPacking() ?>" class="form-control" id="inputName" placeholder="packing">
									</div>
								</div>
						
						<br>
						<div class="form-group">
							<div class="col-xs-offset-3 col-xs-9">
								<input type="submit" class="btn btn-primary" value="Submit">
								<input type="reset" class="btn btn-default" value="Reset">
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		
					<form class="form-horizontal" action="dispatch.php" method="post" >
						<input type="hidden" name="target" value="product_attribute_ca-save">
						<input type="hidden" name="id" value="<?php echo $productBO->getID() ?>">
						<div class="form-group">
							<label class="col-xs-2" for="inputview">Attribute Name:</label>
							<div class="col-xs-3">
								<input type="input" name="name"  class="form-control" id="inputName" placeholder="Attribute Name">
							</div>
							
							<label class="col-xs-2" for="inputview">Attribute Value:</label>
							<div class="col-xs-3">
								<input type="input" name="value"  class="form-control" id="inputName" placeholder="Attribute Value">
							</div>
							<div class="col-xs-2">
								<input type="submit" class="btn btn-primary" value="Submit">
							</div>
						</div>
					</form>
				<div class="table-responsive">
					<table class="table table-striped">
					  <thead>
						<tr>
						  <th>Attribute Name</th>
						  <th>Attribute Value</th>
						  <th>Action</th>
						</tr>
					  </thead>
					  <tbody>
						<?php 
							$cas = $productBO->getCAs(); 
							foreach($cas as $k => $ca)
							{
						?>
						<tr>
						  <td><?php echo $ca->name;?></td>
						  <td><?php echo $ca->value;?></td>
						  <td>
							<div class="btn-group">	
								<a href="dispatch.php?target=product_attribute_ca-delete&id=<?php echo $productBO->getID()?>&caid=<?php echo $ca->id?>"  class="btn btn-default"><span class="glyphicon glyphicon-trash"></span></a>						  
							</div>
						  </td>	
						</tr>
						<?php	
							}
						?>
					  </tbody>
					</table>
				</div>
			
		
	</div>
	
	 <div class="panel-footer">
		<div class="btn-group">
			<form action="dispatch.php" method="post">
				<button type="submit" name="target" value="product-add" class="btn btn-default btn-lg">
					<span class="glyphicon glyphicon-plus"></span> New Product
				</button>
			</form>
		</div>
	</div>	
</div>	
		  
		  
		  
